<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/sys/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList && !showCharge && !showPoints">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.username" @on-enter="query" placeholder="用户ID或会员名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
            </div>
            <div class="buttons-group">
                <!-- <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>  -->
                <i-button type="primary" @click="promoterList"><i class="fa fa-map"></i>&nbsp;粉丝信息</i-button>
<!--                <i-button type="primary" @click="updatePromoter"><i class="fa fa-plus"></i>&nbsp;推广人变更</i-button>-->
<!--                <i-button type="primary" @click="download"><i class="fa fa-plus"></i>&nbsp;下载</i-button>-->
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
<!--                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>-->
<!--                <i-button type="info" @click="exportUser"><i class="fa fa-cloud-download"></i>&nbsp;导出</i-button>-->
                <i-button type="primary" @click="coupon"><i class="fa fa-cc-visa"></i>&nbsp;优惠券</i-button>
                <i-button type="primary" @click="shopCart"><i class="fa fa-shopping-cart"></i>&nbsp;购物车</i-button>
                <i-button type="primary" @click="address"><i class="fa fa-map"></i>&nbsp;收货地址</i-button>

                <i-button type="info" @click="clickShowCharge"><i class="fa fa-pencil-square-o"></i>&nbsp;充值余额</i-button>
                <i-button type="info" @click="clickShowPoints"><i class="fa fa-pencil-square-o"></i>&nbsp;充值积分</i-button>
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList && !showCharge && !showPoints">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="80">
            <Form-item label="会员" prop="username">
                <i-input v-model="user.username" placeholder="会员名称"/>
            </Form-item>
            <!--<Form-item label="会员密码" prop="password">-->
            <!--<i-input v-model="user.password" placeholder="会员密码"/>-->
            <!--</Form-item>-->
            <Form-item label="性别" prop="gender">
                <Radio-group v-model="user.gender">
                    <Radio label="1">
                        <span>男</span>
                    </Radio>
                    <Radio label="2">
                        <span>女</span>
                    </Radio>
                    <Radio label="">
                        <span>未知</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="出生日期" prop="birthday">
                <Date-picker v-model="user.birthday" placeholder="出生日期"></Date-picker>
            </Form-item>
            <!--<Form-item label="注册时间" prop="registerTime">-->
            <!--<Date-picker v-model="user.registerTime" placeholder="注册时间"></Date-picker>-->
            <!--</Form-item>-->
            <!--<Form-item label="最后登录时间" prop="lastLoginTime">-->
            <!--<Date-picker v-model="user.lastLoginTime" placeholder="最后登录时间"></Date-picker>-->
            <!--</Form-item>-->
            <!--<Form-item label="最后登录Ip" prop="lastLoginIp">-->
            <!--<i-input v-model="user.lastLoginIp" placeholder="最后登录Ip"/>-->
            <!--</Form-item>-->
            <Form-item label="会员等级" prop="userLevelId" style="width: 268px;">
                <i-select v-model="user.userLevelId" filterable>
                    <i-option v-for="userLevel in userLevels" :value="userLevel.id" :key="userLevel.id">
                        {{userLevel.name}}
                    </i-option>
                </i-select>
            </Form-item>
            <!--<Form-item label="微信名" prop="nickname">-->
            <!--<i-input v-model="user.nickname" placeholder="微信名"/>-->
            <!--</Form-item>-->
            <Form-item label="手机号码" prop="mobile">
                <i-input v-model="user.mobile" placeholder="手机号码"/>
            </Form-item>
            <Form-item label="身份证号码" prop="idCard">
                <i-input v-model="user.idCard" placeholder="身份证号码"/>
            </Form-item>
            <Form-item label="推广人id" prop="promoterId">
                <i-input v-model="user.promoterId" placeholder="推广人id"/>
            </Form-item>
            <Form-item label="推广人姓名" prop="promoterName">
                <i-input v-model="user.promoterName" placeholder="推广人姓名"/>
            </Form-item>
            <Form-item label="经销商id" prop="fId">
                <i-input v-model="user.fId" placeholder="经销商id"/>
            </Form-item>
            <Form-item label="经销商姓名" prop="fName">
                <i-input v-model="user.fName" placeholder="经销商姓名"/>
            </Form-item>
            <!--<Form-item label="注册Ip" prop="registerIp">-->
            <!--<i-input v-model="user.registerIp" placeholder="注册Ip"/>-->
            <!--</Form-item>-->
            <!--<Form-item label="头像" prop="avatar">-->
            <!--<i-input v-model="user.avatar" placeholder="头像"/>-->
            <!--</Form-item>-->
            <!--<Form-item label="微信Id" prop="weixinOpenid">-->
            <!--<i-input v-model="user.weixinOpenid" placeholder="微信Id"/>-->
            <!--</Form-item>-->
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>

    <Card v-show="showCharge">
        <p slot="title">充值，温馨提示：计提税费充值到可用余额，不计提充值到活动余额，默认为不计提</p>
        <i-form ref="formValidateCharge" :model="user" :rules="ruleValidateCharge" :label-width="80">
            <Form-item label="会员id" prop="id">
                <i-input v-model="user.id" readonly/>
            </Form-item>
            <Form-item label="会员名称" prop="username">
                <i-input v-model="user.username" readonly/>
            </Form-item>
            <Form-item label="充值金额" prop="amount">
                <i-input type="number" v-model="user.amount" placeholder="请输入充值金额"/>
            </Form-item>
            <Form-item label="是否计提税费" prop="isCalFee">
                <Radio-group v-model="user.isCalFee">
                    <Radio label="1">
                        <span>是</span>
                    </Radio>
                    <Radio label="0">
                        <span>否</span>
                    </Radio>
                </Radio-group>
            </Form-item>

            <Form-item label="是否发放100元活动现金券" prop="isCalFee">
                <Radio-group v-model="user.isCoupon">
                    <Radio label="1">
                        <span>是</span>
                    </Radio>
                    <Radio label="0">
                        <span>否</span>
                    </Radio>
                </Radio-group>
            </Form-item>

            <Form-item>
                <i-button type="primary" @click="handleSubmitCharge('formValidateCharge')">提交</i-button>
                <i-button type="warning" @click="reloadCharge" style="margin-left: 8px">返回</i-button>
                <i-button type="ghost" @click="handleResetCharge('formValidateCharge')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>

    <Card v-show="showPoints">
        <p slot="title">充值积分，可以凭积分零售价购买商品，不参与分润</p>
        <i-form ref="formValidatePoints" :model="userPoints" :rules="ruleValidatePoints" :label-width="80">
            <Form-item label="会员id" prop="id">
                <i-input v-model="userPoints.id" readonly/>
            </Form-item>
            <Form-item label="会员名称" prop="username">
                <i-input v-model="userPoints.username" readonly/>
            </Form-item>
            <Form-item label="充值积分" prop="points">
                <i-input type="number" v-model="userPoints.points" placeholder="请输入充值积分"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmitPoints('formValidatePoints')">提交</i-button>
                <i-button type="warning" @click="reloadPoints" style="margin-left: 8px">返回</i-button>
                <i-button type="ghost" @click="handleResetPoints('formValidatePoints')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/static/js/shop/shopuser.js?_${.now?long}"></script>
<script src="${rc.contextPath}/static/js/shop/download2.js?_${.now?long}"></script>
</body>
</html>
